﻿namespace HuwmanCode.Transactions

open System
open System.Runtime.CompilerServices

[<AutoOpen>]
[<Extension>]
[<RequireQualifiedAccess>]
module Action =
    [<Extension>]
    let TryOnTransactionCommit (action:Action) =
        CommitAction.Enlist(action.Invoke)

    [<Extension>]
    let TryOnTransactionRollback (action:Action) =
        RollbackAction.Enlist(action.Invoke)